function compose (...funcs) {
  return function (value) {
    return funcs.reverse().reduce(function (acc, fn) {
      return fn(acc);
    }, value);
  }
}

const reverse = arr => arr.reverse();
const first = arr => arr[0];
const toUpper = s => s.toUpperCase();
const f = compose(toUpper, first, reverse);

console.log(f(['a', 'b', 'c'])); // C